package pl.iachoo.ctl.tabory.dao.core.mybatis;

import java.util.List;

import org.apache.log4j.Logger;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import pl.iachoo.ctl.tabory.dao.api.services.IUserRoleService;
import pl.iachoo.ctl.tabory.dao.core.mybatis.impl.ServiceManager;
import pl.iachoo.ctl.tabory.dao.data.vo.UserRoleVO;

public class Activator implements BundleActivator {

	private final static Logger logger = Logger.getLogger(Activator.class);

	public void start(BundleContext context) throws Exception {
		logger.info("Starting bundle: " + context.getBundle().getSymbolicName());
		IUserRoleService userRoleService = ServiceManager.getUserRoleService();
		List<UserRoleVO> allUserRoles = userRoleService.getAllUserRoles();
		logger.debug(allUserRoles);
		UserRoleVO userRole = userRoleService.getUserRole(new Long(0));
		logger.debug(userRole);
	}

	public void stop(BundleContext context) throws Exception {
		logger.info("Stopping bundle: " + context.getBundle().getSymbolicName());
	}

}
